﻿using System.Diagnostics;

namespace DimensionsHelper.LanguageService.Syntax;

public class MetadataValidation : MetadataSingleArgumentSuffix<StringLiteral>
{
    internal MetadataValidation(SyntaxToken validationKeywordToken, SyntaxNode? parent) :
        base(SyntaxKinds.MetadataValidation,
            validationKeywordToken,
            NodeConverter.ToIdentifier(validationKeywordToken),
            parent)
    {
    }
}


public static partial class NodeFactory
{
    public static MetadataValidation CreateMetadataValidation(SyntaxNode? parent,
        SyntaxToken validationKeywordToken, StringLiteral? value)
    {
        Debug.Assert(validationKeywordToken.IsNode(SyntaxKinds.ValidationKeywordToken));
        MetadataValidation validation = new(validationKeywordToken, parent);
        return UpdateMetadataSingleArgumentSuffix(validation, value);
    }
}